const task = (timer) => {
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            console.log(new Date())
            resolve()
        }, timer);
    })
}

const taskRunner = async () => {
    await task(3000);
    taskRunner();
}
taskRunner();
